import http from "@/api/index";

interface loginParams {
  userName: string,
  password: string,
}  

export function login(data: loginParams ): Promise<any> {
  return http.request({
    url: `/admin/auth/jwtLogin`,
    method: "POST",
    data:data
  });
}
export function getUser( ): Promise<any> {
  return http.request({
    url: `/admin/auth/userInfo`,
    method: "POST",
    data:{}
  });
}

export function addDeviceWork(data:Object): Promise<any> {
  return http.request({
    url:`/device/data/addDeviceWork`,
    method:"POST",
    data:data
  });
}

export function getDeviceWork(data:Object): Promise<any> {
  return http.request({
    url:`/device/data/getDeviceWorkList`,
    method:"POST",
    data:data
  });
}